//! copyright © ecdata.cn 2021 - present
//! 客户应用
//! created by tyn 20250317

use deck::Model;

/// 数据表模型
#[allow(dead_code)]
#[derive(Model, Default, Debug, Clone)]
#[table(name = "per_customer_app", comment = "客户应用", primary = "identity")]
pub struct CustomerApp {
    // 自增序号
    #[field(primary = true, required = true)]
    id: i64,
    // 平台
    platform: i8,
    // 终端类型;1-pc,2-mobile
    #[field(rename = "terminalType")]
    terminal_type: i8,
    // 套餐id
    #[field(rename = "packageId")]
    package_id: i32,
    // 应用代码
    #[field(rename = "appCode")]
    app_code: String,
    // 应用id
    #[field(rename = "appId")]
    app_id: i32,
    // 过期时间
    #[field(rename = "expireTime")]
    expire_time: Option<chrono::NaiveDateTime>,
    // 状态
    #[field(default_value = "1")]
    status: i8,
    // 创建人id
    #[field(rename = "creatorId", default_value = "0")]
    creator_id: i64,
    // 创建时间
    #[field(rename = "createTime", default_value = "current_timestamp()")]
    create_time: Option<chrono::NaiveDateTime>,
    // 数据提供者平台
    provider: i8,
    // 数据提供者id
    #[field(rename = "providerId")]
    provider_id: i64,
    // 修改人id
    #[field(rename = "modifyId", default_value = "0")]
    modify_id: i64,
    // 修改时间
    #[field(rename = "modifyTime", default_value = "current_timestamp()")]
    modify_time: Option<chrono::NaiveDateTime>,
    // 备注
    remark: String,
}
